using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;
using System.Collections;
using System.IO;
namespace CodeFx
{

    //struct Delta
    //{
    //    public long TimeSpan;
    //    public double Distance;
    //}


    public static class LogHelper
    {
        public static string LogFileName()
        {
            return string.Concat(@"\CodeFx.", DateTime.Now.ToFileTime());
            //return string.Concat(Application.StartupPath, @"\CodeFx.Web.", DateTime.Now.ToFileTime ());
        }
     }

    //    public static void WriteLog(string logLine)
    //    {
    //        StreamWriter sw = null;
    //        string logfilename = LogFileName();
    //        if (!(File.Exists(logfilename)))
    //            sw = File.CreateText(logfilename);
    //        else
    //            sw = File.AppendText(logfilename);
    //        sw.WriteLine(logLine);
    //        sw.Close();
    //    }

    //    public static void ReadLog()
    //    {
    //        string logfilename = LogFileName();
    //        StreamReader sr = new StreamReader(logfilename);

    //        string last_latitude = null;
    //        string last_longitude = null;
    //        string last_timeStamp = null;

    //        string new_latitude = null;
    //        string new_longitude = null;
    //        string new_timeStamp = null;
    //        ArrayList CollDelta = new ArrayList();
    //        while (sr.Peek() > -1)
    //        {
    //            string myLine = sr.ReadLine();
    //            MessageHelper.MsgToData(myLine, ref new_latitude, ref new_longitude, ref new_timeStamp);
    //            if (last_timeStamp != null)
    //            {
    //                GF.Latitude Lat = new GF.Latitude(new_latitude);
    //                GF.Longitude Long = new GF.Longitude(new_longitude);
    //                GF.Position new_Pos = new GF.Position(Lat, Long);

    //                Lat = new GF.Latitude(last_latitude);
    //                Long = new GF.Longitude(last_longitude);
    //                GF.Position last_Pos = new GF.Position(Lat, Long);

    //                // never used
    //                //DateTime last_TS = Convert.ToDateTime(last_timeStamp,CultureInfo.InvariantCulture);
    //                //DateTime new_TS = Convert.ToDateTime(new_timeStamp,CultureInfo.InvariantCulture);

    //                Delta delta = new Delta();
    //                delta.Distance = last_Pos.DistanceTo(new_Pos).Value;
    //                delta.TimeSpan = Convert.ToDateTime(new_timeStamp,CultureInfo.InvariantCulture).ToFileTime() - Convert.ToDateTime(last_timeStamp,CultureInfo.InvariantCulture).ToFileTime();
    //                CollDelta.Add(delta);
    //            }
    //            last_latitude = new_latitude;
    //            last_longitude = new_longitude;
    //            last_timeStamp = new_timeStamp;

    //        }
    //        sr.Close();
    //    }

    //}
}
